package ibm.etp.bean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Oracle {
	public static String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
	public static String name = "sys as sysdba";
	public static String Orpassword = "admin";
	public static Connection connection = null;
	public static Statement st = null;
	public static ResultSet rs = null;

	public static ResultSet doOracle(String sql) throws Exception {
		Class.forName("oracle.jdbc.OracleDriver");
		connection = DriverManager.getConnection(url, name, Orpassword);
		st = connection.createStatement();
		rs = st.executeQuery(sql);
		return rs;
	}

	public static void doOracleUpDate(String sql) throws Exception {
		Class.forName("oracle.jdbc.OracleDriver");
		connection = DriverManager.getConnection(url, name, Orpassword);
		st = connection.createStatement();
		st.executeUpdate(sql);
	}

}
